package org.langcom;

import java.io.Serializable;

public class AverageValue implements Serializable {

	private static final long serialVersionUID = -7509706741476059008L;
	private long summ = 0, count = 0, max = 0, min = 0;

	public void add(long val) {
		summ += val;
		count++;
		if (val > max) {
			max = val;
		}
		if (val < min) {
			min = val;
		}
	}

	public double average() {
		return ((double) summ) / count;
	}

	public long getSumm() {
		return summ;
	}

	public long getMax() {
		return max;
	}

	public long getMin() {
		return min;
	}
}
